<template>
  <div>
    <div class="item"
      v-for="(item, index) in list"
      :key="index"
    >
      <div class="item-title border-bottom">
        <span class="item-title-icon"></span>
        {{item.title}}
      </div>
      <div v-if="item.children" class="item-children">
        <detail-list1 :list="item.children"></detail-list1>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  // name 属性 用在递归调用自己的时候
  name: 'DetailList1',
  props: {
    list: Array
  }
}
</script>

<style lang="stylus" scoped>
  .item-title
    line-height .8rem
    font-size .32rem
    padding 0 .2rem
    .item-title-icon
      position relative
      left .06rem
      top .06rem
      display inline-block
      height: .36rem;
      min-width: .08rem;
      background-image: linear-gradient(126deg,#00e0ca 0,#00bfd4 100%)
      margin-right .1rem
      background-size .4rem 3rem
  .item-children
    padding 0 .2rem
</style>
